<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>资管结清选择期次页面</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div id="pageInTab" class="pageInTab">
        <form id="formSet1">
            <div class="fieldset1 tabel_col clearFix">
                <div class="fieldBox col_50">
                    <div class="label"><b>融资租赁合同号</b></div>
                    <div class="field">
                        <span>${prj.lsCntNo}</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label"><b>承租人</b></div>
                    <div class="field">
                        <span>${prj.cstNm }</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label"><b>资方支付表号</b></div>
                    <div class="field">
                        <span>${instPaySch.paySchNo }</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label"><b>结清方式</b></div>
                    <div class="field">
                        <span id="settleWay" name="settleWay">${settleTypNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label"><b>我司支付表号</b></div>
                    <div class="field">
                        <c:forEach items="${ourCompanyPaySchList }" var="ourCompanyPaySch">
                            <span>${ourCompanyPaySch.paySchNo }</span><br/>
                        </c:forEach>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label"><b>开始期次</b></div>
                    <div class="field">
                        <input name="startLsPd" id="startLsPd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
            </div>
            <div class="btnsBox">
                <span id="showBtn1" class="sq-button sq-button-round">预览</span>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    var paySchId = '${instPaySch.id }';
    var prjId = '${instPaySch.prjId }';
    var settleType = '${settleTyp}';
    var startLsPd = ${startLsPd};
    var payPd = ${payPd};
    $(function () {
        $('#formSet1').ligerForm({
            validate: true
        });

        var data = [];
        if (startLsPd == 0) {
            data[0] = {id: startLsPd, text:'到期'}
        } else {
            for (var i = 0; i <= (payPd - startLsPd); i++) {
                var j = startLsPd + i;
                data[i] = {id: j, text: '第' + j + '期'};
            }
        }

        $("#startLsPd").ligerComboBox({
            data: data,
            value: startLsPd,
            readonly: true
        });
    });

    $("#showBtn1").click(function () {
        var startLsPd = liger.get("startLsPd").getValue();
        if (startLsPd == "") {
            $.ligerDialog.SQalert({content: "请选择开始期次！", SQ_type: "error"});
            return;
        }
        var params = '?taskDefKey=FLOW_0000_065_001&prjId=' + prjId + '&settlePd=' + startLsPd + "&settleTyp=" + settleType;
        params += "&fileAuth=1";
        var callbackRefresh = function () {
            Remove_navTab();
            // 回调
            var callback = frameElement.W2W.callback;
            callback();
        }
        if (settleType == '1') {
            Add_navTab('tab_prj_zg_sett_choose' + paySchId, '资管正常结清详情', '<%=path%>/project/financialInst/showZGSettlePage.do' + params, callbackRefresh);
        } else if (settleType == '2') {
            Add_navTab('tab_prj_zg_sett_choose' + paySchId, '资管提前结清详情', '<%=path%>/project/financialInst/showZGSettlePage.do' + params, callbackRefresh);
        }
    });

</script>
</body>
</html>
